package com.ushine.web.communication.signature.custom;

import java.util.Objects;

/**
 * @Author: yls
 * @Date: 2021/12/20 14:34
 * @Description:
 * @Version 1.0
 */
public class OrderNode implements Comparable<OrderNode>{
    private int order;
    private String name;
    private String value;

    public OrderNode(int order, String name, String value) {
        this.order = order;
        this.name = name;
        this.value = value;
    }

    public int getOrder() {
        return order;
    }

    public void setOrder(int order) {
        this.order = order;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public int compareTo(OrderNode o) {
        if (this.order == o.order) {
            return this.name.compareTo(o.name);
        }
        return this.order - o.order;
    }

    @Override
    public boolean equals(Object obj) {
        return super.equals(obj);
    }

    @Override
    public int hashCode() {
        return Objects.hash(order, value);
    }
}
